import VueRouter from 'vue-router'

import homeComponent from './component/homeComponent.vue'
import memberComponent from './component/memberComponent.vue'
import shopcarComponent from './component/shopcarComponent.vue'
import searchComponent from './component/searchComponent.vue'
import newlist from './component/news/newlist.vue'
import newsinfo from './component/news/newsinfo.vue'
import photolist from './component/photos/photolist.vue'
import photoinfo from './component/photos/photoinfo.vue'
import goodslist from './component/goods/goodslist.vue'
import goodsinfo from './component/goods/goodsinfo.vue'
import goodsdesc from './component/goods/goodsdesc.vue'
import goodscomment from './component/goods/goodscomment.vue'
// 3. 创建路由对象
var router = new VueRouter({
    routes: [
        { path: '/', redirect: '/home' },
        { path: '/home', component: homeComponent },
        { path: '/member', component: memberComponent },
        { path: '/shopcar', component: shopcarComponent },
        { path: '/search', component: searchComponent },
        { path: '/home/newlist', component: newlist },
        { path: '/home/newsinfo/:id', component: newsinfo },
        { path: '/home/photolist', component: photolist },
        { path: '/home/photoinfo/:id', component: photoinfo },
        { path: '/home/goodslist', component: goodslist },
        { path: '/home/goodsinfo/:id', component: goodsinfo },
        { path: '/home/goodsdesc/:id', component: goodsdesc, name: 'goodsdesc' },
        { path: '/home/goodscomment/:id', component: goodscomment, name: 'goodscomment' },
    ],
    linkActiveClass: 'mui-active'
})

// 把路由对象暴露出去
export default router